import axios from 'axios'

const request = axios.create({
    // baseURL: process.env.VUE_APP_SERVICE_URL,
    baseURL: process.env.VUE_APP_URL,
    timeout: 5000,
    headers: { 'Api-Token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6IjE0NzgyODAzMTY5OTI0NTg3NTMiLCJleHAiOjE2NzMzMzAxOTEsImlhdCI6MTY0MTc5NDE5MX0.fsGVHe4NEgSmWXAjm9p8JRhULu4s4Yj3KVX0CaX_PEQ' }
})

request.interceptors.response.use(function (response) {
    const res = response.data
    // console.log(res)
    // if (res.code !== 200) {
    //     console.log('请求异常')
    //     return response
    // }
    return res
})

export default request